package com.gujiangbo.hutool;

import cn.hutool.Hutool;
import cn.hutool.bloomfilter.BitMapBloomFilter;
import cn.hutool.bloomfilter.BloomFilterUtil;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import java.util.stream.IntStream;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2021/12/16 17:09
 * @Version: 1.0
 * @Description:HuTool 工具测试
 */
@FixMethodOrder(MethodSorters.JVM)
public class HutoolClientTest {

    @Test
    public void test01() {
        Hutool.printAllUtils(); // 显示所有的tool

    }

    @Test
    public void testBoomFilter() {
        BitMapBloomFilter bitMap = BloomFilterUtil.createBitMap(5);
        IntStream.range(0, 1000).forEach(v -> bitMap.add(String.valueOf(v)));
        boolean result = bitMap.contains(String.valueOf(222222));
        System.out.println(result);


    }
}
